package com.wc.alorithm_blue_bridge._排序.训练士兵;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/3/5 7:57
 * @description
 * https://www.lanqiao.cn/courses/46292/learning/?id=3436969&compatibility=false
 */
public class Main {
    /**
     * 组团是全部的
     * 但是有些只需要 c次的, 所以只需要求出最小的时候, 是否可以满足 sum > s, 就可以接着练
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static long[][] a = new long[N][2];
    static int n;
    static long s;

    public static void main(String[] args) {
        n = sc.nextInt();
        s = sc.nextLong();
        for (int i = 1; i <= n; i++) {
            a[i][0] = sc.nextInt();
            a[i][1] = sc.nextInt();
        }
        Arrays.sort(a, 1, n + 1, Comparator.comparing(o -> o[1]));
        // 总体需要的数
        long sum = 0;

        for (int i = 1; i <= n; i++) sum += a[i][0];
        int j = 1;
        long res = 0, cnt = 0;
        while (sum > s) {
            cnt = a[j][1];
            sum -= a[j][0];
            j++;
        }
        res += cnt * s;

        for (int i = j; i <= n; i++) {
            res += (a[i][1] - cnt) * a[i][0];
        }
        out.println(res);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

